﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class CalendarManage_ScheduleNotice : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["UserName"] == null)
        {
            Response.Write("<script>alert('请先登录!');window.location.href='../Login.aspx'</script>");
        }
        else
        {
            if (!IsPostBack)
            {
                int id = Convert.ToInt32(Request["id"].ToString());
                SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["Connection"]);
                con.Open();
                string sql = "select * from Calendar where id=" + id + "";
                SqlDataAdapter da = new SqlDataAdapter(sql, con);
                DataSet ds = new DataSet();
                da.Fill(ds);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    lblTitle.Text = "你有" + ds.Tables[0].Rows.Count.ToString() + "条日程安排信息";

                }


                lblTotal.Text += "<a  href=HavingCalendar.aspx  target='main'>查看详细信息</a>";
               // lblTotal.Text = "<span style='cursor:hand' onclick=\"window.open('HavingCalendar.aspx?id=" + id + "','test','width=650,height=250,top=250,left=280')\">显示详细信息</span>";
          
            }
           
           
        }
    }
}
